/**
 * 作者: hwp
 * 日期: 2025-05-14 09:24:43
 * 备注: 用户联盟礼盒领取记录
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.base.AllParam;
import com.motu.vertx.module.utility.toolset.TimeUtils;

public class UserUnionGiftBoxRecord extends UserUnionGiftBoxRecordModel {
    public UserUnionGiftBoxRecord() {
        super();
    }
    public UserUnionGiftBoxRecord(long userId, long giftBoxId, long activateTime) {
        putUserId(userId);
        putGiftBoxId(giftBoxId);
        putActivateTime(activateTime);
    }

    public void reset() {
        if (getActivateTime() + (long) AllParam.UNION_GIFT_BOX_SUSTAIN_TIME * TimeUtils.HOUR <= TimeUtils.getCurTime()) { // 只保留24小时
            delete();
        }
    }
}
